import request from "@/utils/request"


export const getAllTravelogues = (data) => {
    return request({
        url: "/api/travelogue/all",
        method: "post",
        data
    });
}


export const getTravelogueById = (id) => {
    return request({
        url: `/api/travelogue/${id}`,
        method: "get"
    });
}


// 修改API调用方法
export const addTravelogue = (data) => {
    return request({
        url: "/api/travelogue/add",
        method: "post",
        data
    });
}


export const updateTravelogue = (data) => {
    return request({
        url: "/api/travelogue/update",
        method: "put",
        data
    });
}

export const deleteTravelogue = (id) => {
    return request({
        url: `/api/travelogue/delete/${id}`,
        method: "get"
    });
}
export const getAllTags= () => {
    return request({
        url: `/api/tags/all`,
        method: "get"
    });
}
export const getTopTravelogue= (length) => {
    return request({
        url: `/api/travelogue/top/${length}`,
        method: "get"
    });
}
